<%@ Control %>
<%@ Register TagPrefix="CS" Namespace="CommunityServer.Controls" Assembly="CommunityServer.Controls" %>

<div class="CommonContentArea">
	<div class="CommonContent">
		<div class="CommonFormArea">
		
		<CS:Donut runat="server" ID="Error" Visible="False">
			<div class="CommonValidationWarning">
				<asp:Literal Runat="server" />		
			</div>
		</CS:Donut>
				
		<table width="100%" cellpadding="0" cellspacing="0" border="0">
			<tr>
				<td class="CommonFormDescription" colspan="3">
					<asp:Literal Runat="server" ID="Instructions" />
				</td>
			</tr>
			<tr valign="top" runat="server" id="LocalAttachmentArea">
				<td class="CommonFormField">
					<asp:RadioButton ID="UploadFile" runat="server" GroupName="UploadOption" Checked="True" />
				</td>
				<td class="CommonFormFieldName">
					<CS:ResourceControl ResourceName="UploadAttachment_File" runat="server" ID="Resourcecontrol1"/>
					<div class="CommonFormFieldDescription">
						<CS:ResourceControl ResourceName="UploadAttachment_File_Description" runat="server" ID="Resourcecontrol2"/>				
					</div>
				</td>
				<td class="CommonFormField"><input id="File" type="file" runat="server" /></td>
			</tr>
			<tr valign="top" runat="server" id="RemoteAttachmentArea">
				<td class="CommonFormField">
					<asp:RadioButton ID="LinkToUrl" Runat="server" GroupName="UploadOption" />
				</td>
				<td class="CommonFormFieldName">
					<CS:ResourceControl ResourceName="UploadAttachment_Url" runat="server" ID="Resourcecontrol3"/>
					<div class="CommonFormFieldDescription">
						<CS:ResourceControl ResourceName="UploadAttachment_Url_Description" runat="server" ID="Resourcecontrol4"/>
					</div>
				</td>
				<td class="CommonFormField"><asp:TextBox ID="Url" Runat="server" Columns="40" /></td>
			</tr>
			<tr>
				<td colspan="3" class="CommonFormActionButtons">
					<asp:LinkButton id="Save" Runat="server" CssClass="CommonTextButton" />
				</td>
			</tr>
		</table>
		</div>
	</div>
</div>

<script language="javascript">

function enableFileUpload()
{
	var e = document.getElementById('<%= File.ClientID %>');
	if (e) { e.disabled = false; }
	e = document.getElementById('<%= Url.ClientID %>');
	if (e) { e.disabled = true; }
}

function enableLinkToUrl()
{
	var e = document.getElementById('<%= File.ClientID %>');
	if (e) { e.disabled = true; }
	e = document.getElementById('<%= Url.ClientID %>');
	if (e) { e.disabled = false; }
}

var e = document.getElementById('<%= UploadFile.ClientID %>');
if (e) { e.onclick = enableFileUpload; }
if (e && e.checked)
	enableFileUpload();

e = document.getElementById('<%= LinkToUrl.ClientID %>')
if (e) { e.onclick = enableLinkToUrl; }
if (e && e.checked)
	enableLinkToUrl();

</script>